package com.t2tierp.pafecf.controller;

import br.com.modelo.NfeConfiguracao;
import br.com.util.JPAUtil;
import javax.persistence.EntityManager;
import javax.persistence.Query;

/**
 *
 * @author Gilberto
 */
public class NfeConfiguracaoControler {

    public NfeConfiguracao retornaConfiguracaoNfe() {
        EntityManager em = JPAUtil.retornarFabrica().createEntityManager();
        Query q = em.createNamedQuery("FROM NfeConfiguracao");
        NfeConfiguracao retorno;
        try {
            retorno = (NfeConfiguracao) q.getSingleResult();
            em.close();
            return retorno;
        } catch (javax.persistence.NoResultException e) {
            em.close();
            return null;
        }
    }
}
